package com.dones.misc;

public class Class1 implements Comparable<Class1>{
	
	double currency;	
	String nameA;
	String nameB;
	String nameC;
	
	public double getCurrency() {
		return currency;
	}
	public void setCurrency(double currency) {
		this.currency = currency;
	}
	public String getNameA() {
		return nameA;
	}
	public void setNameA(String nameA) {
		this.nameA = nameA;
	}
	public String getNameB() {
		return nameB;
	}
	public void setNameB(String nameB) {
		this.nameB = nameB;
	}
	public String getNameC() {
		return nameC;
	}
	public void setNameC(String nameC) {
		this.nameC = nameC;
	}
	@Override
	public String toString() {
		return "Class1 [currency=" + currency + ", nameA=" + nameA + ", nameB="
				+ nameB + ", nameC=" + nameC + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(currency);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((nameA == null) ? 0 : nameA.hashCode());
		result = prime * result + ((nameB == null) ? 0 : nameB.hashCode());
		result = prime * result + ((nameC == null) ? 0 : nameC.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Class1 other = (Class1) obj;
		if (Double.doubleToLongBits(currency) != Double
				.doubleToLongBits(other.currency))
			return false;
		if (nameA == null) {
			if (other.nameA != null)
				return false;
		} else if (!nameA.equals(other.nameA))
			return false;
		if (nameB == null) {
			if (other.nameB != null)
				return false;
		} else if (!nameB.equals(other.nameB))
			return false;
		if (nameC == null) {
			if (other.nameC != null)
				return false;
		} else if (!nameC.equals(other.nameC))
			return false;
		return true;
	}
	@Override
	public int compareTo(Class1 o) {
		// TODO Auto-generated method stub
		return (int) (this.currency - o.currency);
	}
	
	
	
	
	
}
